package com.zy.chat.controller;

import com.zy.chat.entity.Comments;
import com.zy.chat.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author zy
 * @date 2023/5/17 17:16
 */


@Controller
@RequestMapping(value = "commenttroller")
public class CommentController {

    @Autowired
    private CommentService commentService;


    @PostMapping(value = "/insert")
    public ResponseEntity<Integer> insert(@RequestBody Comments comments){
        return  new ResponseEntity<Integer>(commentService.insert(comments), HttpStatus.OK);
    }
}
